package com.cc.demo.mesage.service;

import org.springframework.messaging.Message;
import org.springframework.messaging.support.ErrorMessage;

import java.util.Date;
import java.util.Optional;

public interface MessageService {

    Optional<String> getDestinationName(Message<?> message);

    Optional<String> getDestinationName(ErrorMessage errorMessage);

    Optional<Date> getReceivedTime(Message<?> message);

    Optional<Date> getReceivedTime(ErrorMessage errorMessage);

    Optional<String> getMessageContent(ErrorMessage errorMessage);

    Optional<Integer> getDeliveryTimes(ErrorMessage errorMessage);

    Optional<Integer> getDeliveryTimes(Message<?> message);

    Optional<String> getContentType(Message<?> message);

    Optional<Long> getDuration(Message<?> message);

}
